import React from "react";
import { useSearchParams } from "react-router-dom";

export default function Params() {
  const [search, setSearch] = useSearchParams();
  const id = search.get("id");
  const content = search.get("content");

  return (
    <>
      <button onClick={() => setSearch("id=100&content=修改")}>
        点击修改search内容
      </button>
      <ul>
        <li>{id}</li>
        <li>{content}</li>
      </ul>
    </>
  );
}
